package com.wanxi.string;

import java.util.Scanner;

public class StudentInformation {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
//        System.out.println("请输入一串字符串（一段话）： ");

        System.out.println("请输入第一个学生的信息");
        String studentInformation1 = scanner.next();
        String[] studentInformationArray1 = studentInformation1.split("，");
        Student student1 = new Student(studentInformationArray1[0],studentInformationArray1[1]);

        System.out.println("请输入第二个学生的信息");
        String studentInformation2 = scanner.next();
        String[] studentInformationArray2 = studentInformation2.split("，");
        Student student2 = new Student(studentInformationArray2[0],studentInformationArray2[1]);

        System.out.println("请输入第三个学生的信息");
        String studentInformation3 = scanner.next();
        String[] studentInformationArray3 = studentInformation3.split("，");
        Student student3 = new Student(studentInformationArray3[0],studentInformationArray3[1]);

        Student[] allStudentArray = new Student[3];

       allStudentArray[0]=student1;
       allStudentArray[1]=student2;
       allStudentArray[2]=student3;

        for (int i = 0; i < allStudentArray.length; i++) {

            allStudentArray[i].getInformation();
        }




    }

}
